// JS 是表现力极强的语言
// 对象字面量
const fhj = {
    name : 'fu hai jian',
    sex :'man',
    ifhasgirlfriend:false,
    hometown:'fengcheng',
    room:'nb247'
}
fhj.room ='4301';
console.log(fhj);

// 传统，保守一点
const children =[];
class Person {
    constructor(name,sex){
        this.name = name;
        this.sex = sex;
        if(children.length>=2){
            console.log('thank for your child');
        }
    }

}
const fu1 = new Person('fu big');
children.push(fu1);
const fu2 = new Person('fu small');
children.push(fu2);
const fu3 = new Person('fu small small');
children.push(fu3);
console.log(children,typeof children);
console.log(fu1.name);
{
    var blockI = 'i';
}
console.log(blockI);
const ele = document.getElementById('user');
const nameEle = document.createElement('div');
nameEle.innerText = fhj.name;
ele.appendChild(
    nameEle
)
const el = document.getElementById('hometown');
const homeEle = document.createElement('span');
homeEle.innerText = fhj.hometown;
ele.appendChild(
    homeEle
)
ele.innerHTML=`
    <div>name:${fhj.name}</div>
    <div>hometown:${fhj.hometown}</div>
    <div>sex:${fhj.sex}</div>
`
ele.appendChild(

)